<html>
<head><meta charset="utf-8"><title>symbol manging #83611 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html">symbol manging #83611</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235681958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235681958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235681958">(Apr 22 2021 at 13:58)</a>:</h4>
<p>PR: <a href="https://github.com/rust-lang/rust/issues/83767">#83767</a></p>



<a name="235682012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682012">(Apr 22 2021 at 13:58)</a>:</h4>
<p>Was about to make this lol</p>



<a name="235682030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682030">(Apr 22 2021 at 13:58)</a>:</h4>
<p>Issue here: <a href="https://github.com/rust-lang/rust/issues/83611">#83611</a></p>



<a name="235682384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682384">(Apr 22 2021 at 14:00)</a>:</h4>
<p>I guess there are two questions</p>



<a name="235682411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682411">(Apr 22 2021 at 14:00)</a>:</h4>
<ul>
<li>what is the correct encoding?</li>
</ul>



<a name="235682444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682444">(Apr 22 2021 at 14:00)</a>:</h4>
<ul>
<li>how to implement it?</li>
</ul>



<a name="235682569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682569">(Apr 22 2021 at 14:00)</a>:</h4>
<p>I <em>think</em> everyone on the thread is currently arguing for preserving roughly this encoding?</p>
<div class="codehilite"><pre><span></span><code>for&lt;&gt; [
  ExistentialProjection::Trait(Self: FnMut),
  ExistentialProjection::Projection(&lt;Self as FnMut&gt;::Output = &amp;u8)
]
</code></pre></div>



<a name="235682879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682879">(Apr 22 2021 at 14:02)</a>:</h4>
<p>I don't quite understand the plan for more complex situations</p>



<a name="235682907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682907">(Apr 22 2021 at 14:02)</a>:</h4>
<p>I also have never looked <em>that</em> closely into the symbol mangling</p>



<a name="235682929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235682929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235682929">(Apr 22 2021 at 14:02)</a>:</h4>
<p>does it support, e.g., nested binders?</p>



<a name="235683043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683043">(Apr 22 2021 at 14:03)</a>:</h4>
<p>I'm wondering about situations like this:</p>



<a name="235683048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683048">(Apr 22 2021 at 14:03)</a>:</h4>
<p>So, yes</p>



<a name="235683095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683095">(Apr 22 2021 at 14:03)</a>:</h4>
<p>I think that's roughly the encoding being argued for</p>



<a name="235683118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683118">(Apr 22 2021 at 14:03)</a>:</h4>
<p>(i.e. don't break anything)</p>



<a name="235683139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683139">(Apr 22 2021 at 14:03)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">Output</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span>: <span class="nc">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">dyn</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"></span>
</code></pre></div>



<a name="235683177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683177">(Apr 22 2021 at 14:03)</a>:</h4>
<p>For nested binders, I think we encode the <em>desugared</em> form</p>



<a name="235683248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683248">(Apr 22 2021 at 14:04)</a>:</h4>
<p>here, the <code>for&lt;'a, 'b&gt; ExistentialProjection::Projection(&lt;Self as Foo&gt;::Output = u32)</code> is a bit silly</p>



<a name="235683333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683333">(Apr 22 2021 at 14:04)</a>:</h4>
<p>I'm definitely not super happy about encoding that flattening etc in our ABI :)</p>



<a name="235683426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683426">(Apr 22 2021 at 14:05)</a>:</h4>
<p>For associated type bindings?</p>



<a name="235683527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683527">(Apr 22 2021 at 14:05)</a>:</h4>
<p>giving this some thought, I think the most "future proof' is to hew as closely as we can to the user syntax</p>



<a name="235683596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683596">(Apr 22 2021 at 14:06)</a>:</h4>
<p>but there's a bit of a challenge because maybe there are different, but equivalent, notations</p>



<a name="235683637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683637">(Apr 22 2021 at 14:06)</a>:</h4>
<p>Right</p>



<a name="235683646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683646">(Apr 22 2021 at 14:06)</a>:</h4>
<p>at minimum there's naming and ordering</p>



<a name="235683662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683662">(Apr 22 2021 at 14:06)</a>:</h4>
<p>canonicalization and so forth helps with that</p>



<a name="235683790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683790">(Apr 22 2021 at 14:07)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> well, for example, I'm imagining that we could re-introduce nested binders into predicates (like chalk)</p>



<a name="235683806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683806">(Apr 22 2021 at 14:07)</a>:</h4>
<p>then maybe we would lower things differently</p>



<a name="235683892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683892">(Apr 22 2021 at 14:07)</a>:</h4>
<p>The symbol mangling in <em>this</em> issue actually follows syntax more closely than the representation in code</p>



<a name="235683922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683922">(Apr 22 2021 at 14:07)</a>:</h4>
<p>right</p>



<a name="235683949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683949">(Apr 22 2021 at 14:07)</a>:</h4>
<p>my first reaction was to think that the new version is better</p>



<a name="235683955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235683955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235683955">(Apr 22 2021 at 14:08)</a>:</h4>
<p>but now I'm second guessing it</p>



<a name="235684015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684015">(Apr 22 2021 at 14:08)</a>:</h4>
<p>Whereas I don't think any thought has been given to ATBs</p>



<a name="235684040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684040">(Apr 22 2021 at 14:08)</a>:</h4>
<p>because I want to preserve some freedom for us to be like "mmm maybe we want to change the desugared predicates"</p>



<a name="235684229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684229">(Apr 22 2021 at 14:09)</a>:</h4>
<p>The new version makes more sense if we ever allow something like <code>dyn Foo + &lt;Self as Bar&gt;::Baz = ()</code></p>



<a name="235684277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684277">(Apr 22 2021 at 14:09)</a>:</h4>
<p>i.e. a projection predicate <em>without</em> a trait predicate</p>



<a name="235684294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684294">(Apr 22 2021 at 14:09)</a>:</h4>
<p>but that's maybe a bit weird</p>



<a name="235684347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684347">(Apr 22 2021 at 14:09)</a>:</h4>
<p>(and what would that even <em>mean</em>)</p>



<a name="235684520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684520">(Apr 22 2021 at 14:10)</a>:</h4>
<p>I guess I think I don't want to think about this <em>too</em> much right now</p>



<a name="235684534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684534">(Apr 22 2021 at 14:10)</a>:</h4>
<p>Right</p>



<a name="235684544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684544">(Apr 22 2021 at 14:10)</a>:</h4>
<p>and we should try to preserve the output so we don't have to</p>



<a name="235684563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684563">(Apr 22 2021 at 14:10)</a>:</h4>
<p>Yes</p>



<a name="235684689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684689">(Apr 22 2021 at 14:11)</a>:</h4>
<p>I'm not sure why <span class="user-mention silent" data-user-id="119009">eddyb</span> wanted you to review? Maybe because there might be some disagreement to <em>how</em> to preserve the output?</p>



<a name="235684698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684698">(Apr 22 2021 at 14:11)</a>:</h4>
<p>i'm not 100% convinced that the new assertions will work</p>



<a name="235684717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684717">(Apr 22 2021 at 14:11)</a>:</h4>
<p>I think they were right to tag me in</p>



<a name="235684749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684749">(Apr 22 2021 at 14:12)</a>:</h4>
<p>but I'm happy with the PR for now</p>



<a name="235684839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684839">(Apr 22 2021 at 14:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/symbol.20manging.20.2383611/near/235683139">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">Output</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span>: <span class="nc">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">dyn</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>



<a name="235684853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684853">(Apr 22 2021 at 14:12)</a>:</h4>
<p>what happens here?</p>



<a name="235684878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684878">(Apr 22 2021 at 14:12)</a>:</h4>
<p>I guess we make the binders with unused variables right now?</p>



<a name="235684889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684889">(Apr 22 2021 at 14:12)</a>:</h4>
<p>Yes</p>



<a name="235684895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684895">(Apr 22 2021 at 14:12)</a>:</h4>
<p>can't we wind up with extra variables?</p>



<a name="235684943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684943">(Apr 22 2021 at 14:13)</a>:</h4>
<p>Well, hold on</p>



<a name="235684958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684958">(Apr 22 2021 at 14:13)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">Output</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">dyn</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"></span>
</code></pre></div>



<a name="235684992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235684992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235684992">(Apr 22 2021 at 14:13)</a>:</h4>
<p>or even</p>



<a name="235685023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685023">(Apr 22 2021 at 14:13)</a>:</h4>
<p>This doesn't use <code>bound_vars()</code></p>



<a name="235685038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685038">(Apr 22 2021 at 14:13)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">Output</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">c</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">dyn</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"></span>
</code></pre></div>



<a name="235685056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685056">(Apr 22 2021 at 14:13)</a>:</h4>
<p>It searches the types for bound vars</p>



<a name="235685160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685160">(Apr 22 2021 at 14:14)</a>:</h4>
<p>It uses <code>tcx.collect_referenced_late_bound_regions</code></p>



<a name="235685209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685209">(Apr 22 2021 at 14:14)</a>:</h4>
<p>I see</p>



<a name="235685222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685222">(Apr 22 2021 at 14:14)</a>:</h4>
<p>still</p>



<a name="235685242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685242">(Apr 22 2021 at 14:14)</a>:</h4>
<p>I'm not sure that makes it better?</p>



<a name="235685333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685333">(Apr 22 2021 at 14:15)</a>:</h4>
<p>I'm not sure it makes it <em>better</em>, but it does mean that it won't break</p>



<a name="235685372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685372">(Apr 22 2021 at 14:15)</a>:</h4>
<p>So</p>



<a name="235685376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685376">(Apr 22 2021 at 14:15)</a>:</h4>
<p>that's what I don't understand</p>



<a name="235685395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685395">(Apr 22 2021 at 14:15)</a>:</h4>
<p>I guess it depends on what it is searching</p>



<a name="235685516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685516">(Apr 22 2021 at 14:16)</a>:</h4>
<p>I'm trying to think of the best way to word this</p>



<a name="235685560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685560">(Apr 22 2021 at 14:16)</a>:</h4>
<p>Well actually, I think the assertion as-is will break with supertrait HRTBs</p>



<a name="235685588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685588">(Apr 22 2021 at 14:16)</a>:</h4>
<p>You're right there</p>



<a name="235685602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685602">(Apr 22 2021 at 14:16)</a>:</h4>
<p>But the code otherwise should be fine</p>



<a name="235685649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685649">(Apr 22 2021 at 14:17)</a>:</h4>
<p>I'd like to see some tests for those situations</p>



<a name="235685687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685687">(Apr 22 2021 at 14:17)</a>:</h4>
<p>Me too</p>



<a name="235685720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685720">(Apr 22 2021 at 14:17)</a>:</h4>
<p>Is there test coverage for the symbol mangling at all?</p>



<a name="235685725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685725">(Apr 22 2021 at 14:17)</a>:</h4>
<p>yes, right?</p>



<a name="235685816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685816">(Apr 22 2021 at 14:18)</a>:</h4>
<p><code>src/test/ui/symbol-names</code></p>



<a name="235685839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685839">(Apr 22 2021 at 14:18)</a>:</h4>
<p>I expect the assertion to break, but without the assertion I would expect that we are emitting <code>for&lt;'a, 'b&gt;</code> on both sets of predicates</p>



<a name="235685982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235685982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235685982">(Apr 22 2021 at 14:19)</a>:</h4>
<p>Well, we don't <em>emit</em> the bound vars for the <code>Projection</code> part of the predicate</p>



<a name="235686047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235686047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235686047">(Apr 22 2021 at 14:19)</a>:</h4>
<p>Which is the crux of the issue</p>



<a name="235686307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/235686307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#235686307">(Apr 22 2021 at 14:21)</a>:</h4>
<p>right</p>



<a name="238911366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911366">(May 15 2021 at 17:03)</a>:</h4>
<p>So, uh. I think mangling of trait objects with auto traits is just wrong...</p>



<a name="238911516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911516">(May 15 2021 at 17:04)</a>:</h4>
<p>Well, at least, it's wrong for 2 of the 3 places we build up the existential predicates</p>



<a name="238911553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911553">(May 15 2021 at 17:05)</a>:</h4>
<p>The mangling reference:</p>
<div class="codehilite"><pre><span></span><code>&lt;dyn-bounds&gt; = &lt;binder&gt; {&lt;dyn-trait&gt;} &quot;E&quot;
&lt;dyn-trait&gt; = &lt;path&gt; {&lt;dyn-trait-assoc-binding&gt;}
&lt;dyn-trait-assoc-binding&gt; = &quot;p&quot; &lt;undisambiguated-identifier&gt; &lt;type&gt;
</code></pre></div>



<a name="238911676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911676">(May 15 2021 at 17:06)</a>:</h4>
<p>So, for something like </p>
<div class="codehilite"><pre><span></span><code>dyn for&lt;&#39;a&gt; Foo&lt;&#39;a, Bar = &amp;&#39;a ()&gt; + Send
</code></pre></div>
<p>we mangle essentially </p>
<div class="codehilite"><pre><span></span><code>[&#39;a] &lt;Foo&lt;&#39;a&gt;&gt; p &lt;Bar = &amp;&#39;a ()&gt; &lt;Send&gt; E
</code></pre></div>



<a name="238911773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911773">(May 15 2021 at 17:08)</a>:</h4>
<p>Well, the assumption of the symbol mangler (even before my changes) is that it can essentially print these in order</p>



<a name="238911829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911829">(May 15 2021 at 17:08)</a>:</h4>
<p>So, before, everything was under a single binder, so that takes care of the <code>['a]</code></p>



<a name="238911883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911883">(May 15 2021 at 17:09)</a>:</h4>
<p>But this still requires that it's principal trait, then projections for principal trait, then auto traits</p>



<a name="238911943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238911943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238911943">(May 15 2021 at 17:10)</a>:</h4>
<p>When we build up the existential predicates in <code>confirmation</code>, we do that:</p>
<div class="codehilite"><pre><span></span><code>                let iter = data_a
                    .principal()
                    .map(|b| b.map_bound(ty::ExistentialPredicate::Trait))
                    .into_iter()
                    .chain(
                        data_a
                            .projection_bounds()
                            .map(|b| b.map_bound(ty::ExistentialPredicate::Projection)),
                    )
                    .chain(
                        data_b
                            .auto_traits()
                            .map(ty::ExistentialPredicate::AutoTrait)
                            .map(ty::Binder::dummy),
</code></pre></div>



<a name="238912041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238912041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238912041">(May 15 2021 at 17:10)</a>:</h4>
<p>But in <code>object_safety</code> and <code>astconv</code>, it's principal trait, auto traits, predicates</p>



<a name="238912116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238912116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238912116">(May 15 2021 at 17:12)</a>:</h4>
<p>Okay, <code>object_safety</code> at least doesn't have auto traits</p>



<a name="238919674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/symbol%20manging%20%2383611/near/238919674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/symbol.20manging.20.2383611.html#238919674">(May 15 2021 at 19:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang/rust/issues/83767">#83767</a> is ready</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>